<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CouponOrderSid extends Migrator
{
    public function up()
    {
        $table = $this->table('coupon_order_sid', ['id' => 'id', 'comment' => '订单自定义跟踪表', 'engine' => 'InnoDB'  ]);
        $table->addColumn('agent_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '代理'])
            ->addColumn('user_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '用户'])
            ->addColumn('channel_id', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '渠道'])
            ->addColumn('settle_type', 'integer', ['limit' => 11, 'default' => 1, 'comment' => '下单时结算类型1返佣2供应商接口'])
            ->addColumn('settle_discount', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '下单时结算折扣'])
            ->addTimestamps()
            ->create();

    }

    public function down()
    {
        $this->table('coupon_order_sid')->drop();
    }

}
